﻿using System;
using System.Collections.Generic;

namespace MvcForum.Net.Bussiness
{
    public class NotificationRepo
    {
        public static int Check(int userId,bool isAdmin, DateTime lastCheck)
        {
            return MainDB.Instant.Notification_Check(userId,isAdmin, lastCheck).ExecuteScalar<int>();
        }

        public static void Save(short cmd, int from, int to,int?forumId,int? topicId, string location)
        {
            MainDB.Instant.Notification_Save(cmd, from, to,forumId,topicId, location).Execute();
        }

        public static List<Notification> List(int userId, bool isAdmin, int pageIndex, int pageSize)
        {
            var sp = MainDB.Instant.Notification_List(userId, isAdmin, pageIndex, pageSize);

            var _list = sp.ExecuteTypedList<Notification>();

            return _list;
        }

    }
}
